<?php
$openningTime = strtotime($detail['CourseDetail']['opening_date']);
$closingTime = strtotime($detail['CourseDetail']['closing_date']);
?>
<h1 id="mainTitle" class="schedule">このクラスの参加をキャンセルします</h1>
<?php echo $this->Form->create('CourseDetail', array('url' => array('controller' => 'course', 'action' => 'leave'), 'method' => 'POST'));?>
<?php echo $this->Form->hidden('id', array('value' => $detail['CourseDetail']['id']));?>
<?php echo $this->Form->hidden('course_id', array('value' => $detail['CourseDetail']['course_id']));?>
	<?php if (!$canLeave):?>
	<p class="leaveAttention">
		キャンセル可能な期限が過ぎているためキャンセルができません<br />
		前のページに戻るボタンからお戻りください
	</p>
	<?php endif;?>
	<table class="schedule">
		<tr class="first">
			<td class="left">受講コース名</td>
			<td><?php echo $course['Course']['title'];?></td>
		</tr>
		<tr>
			<td class="left">講師名</td>
			<td><?php echo $this->User->getUsername($course);?>&nbsp;</td>
		</tr>
		<tr>
			<td class="left">開始日時</td>
			<td><?php echo date(Configure::read('date_format'), $openningTime);?> ~ <?php echo date(Configure::read('date_format'), $closingTime);?></td>
		</tr>
		<tr>
			<td class="left">エリア</td>
			<td><?php echo $detail['Area']['name'] ? $detail['Area']['name'] : $course['Area']['name'];?></td>
		</tr>
		<tr>
			<td class="left">開催場所</td>
			<td>
				<ul>
					<li>〒<?php echo $detail['CourseDetail']['zip01'];?>&nbsp;-&nbsp;<?php echo $detail['CourseDetail']['zip02'];?></li>
					<li><?php echo $detail['CourseDetail']['address01'];?></li>
					<li><?php echo $detail['CourseDetail']['address02'];?></li>
					<li><?php echo $detail['CourseDetail']['place_name'];?></li>
				</ul>
			</td>
		</tr>
		<tr class="last">
			<td class="left">参加費用</td>
			<td>¥<?php echo $detail['CourseDetail']['price'] ? number_format($detail['CourseDetail']['price']) : $detail['Course']['price'];?></td>
		</tr>
		<tr>
			<td colspan="2" class="submit">
				<?php if ($canLeave):?>
				<?php echo $this->Form->submit('btn_entry_cancel_off.png', array('div' => false));?>
				<?php endif;?>
				<?php echo $this->Html->link($this->Html->image('btn_back_off.png'), $backUrl, array('class' => 'cancelBtn', 'escape' => false));?>
			</td>
		</tr>
	</table>
<?php echo $this->Form->end();?>
<?php echo $this->element('top_link');?>
